/*
 ***************************************************************************
 * MediaTeK Inc.
 * 4F, No. 2 Technology	5th	Rd.
 * Science-based Industrial	Park
 * Hsin-chu, Taiwan, R.O.C.
 *
 * (c) Copyright 2002-2012, MTK.
 *
 * All rights reserved.	MediaTeK's source	code is	an unpublished work	and	the
 * use of a	copyright notice does not imply	otherwise. This	source code
 * contains	confidential trade secret material of MediaTeK Tech. Any attemp
 * or participation	in deciphering,	decoding, reverse engineering or in	any
 * way altering	the	source code	is stricitly prohibited, unless	the	prior
 * written consent of MediaTeK, Inc. is obtained.
 ***************************************************************************

	Module Name:
	omci_check_memory_leak.h

	Abstract:

	Revision History:
	Who			When			What
	--------	----------		----------------------------------------------
	Name		Date			Modification logs
	joy.zou		2018/8/07	Create
*/
#ifndef _OMCI_CHECK_MEMORY_LEAK_H_
#define _OMCI_CHECK_MEMORY_LEAK_H_


#include <stdio.h>
#include <stdlib.h>



/************************************************************************
*                        			MACRO							
************************************************************************
*/
#ifdef MEMORY_DEBUG

#define calloc(x,y)   calloc_dbg(x,y,__FUNCTION__,__LINE__)
#define malloc(x)     malloc_dbg(x,__FUNCTION__,__LINE__)
#define realloc(x,y)  realloc_dbg(x,y,__FUNCTION__,__LINE__)
#define free(x)       free_dbg(x)



void *calloc_dbg(unsigned int num,unsigned int size,const char *funcname,const unsigned int line);
void *malloc_dbg(unsigned int size,const char *funcname,const unsigned int line);
void *realloc_dbg(void *ptr, unsigned int size, const char *funcname,unsigned int line);

void free_dbg(void *ptr);
int dump_check_memory();
int init_check_memory();
int deinit_check_memory();

#endif




/************************************************************************
*                        			struct							
************************************************************************
*/





#endif

